|
|
|
|
|
|
|
This example is from the For/Next Step 2 command button: |
|
|
|
 |
|
|
|
|
Private Sub cmdForStep2_Click ()
Dim intLoop As Integer
Cls
For intLoop = 5 To 50 Step 5
Print intLoop
Next intLoop
End Sub |
|
|
|
 |
|
|
|
|
TIP Putting the variable name after the Next statement is sometimes more efficient and more readable than using Next by itself. |
|
|
|
|
|
|
|
|
The For . . . Next Example |
|
|
|
|
|
|
|
|
Lets write some code thats very typical in a real-world situation. Remember the email form you created in Chapter 5? Lets add a list box to that form of mailing addresses for people you would send email to. Make this list box a multiselect list box so that you can send email to multiple people. After you make your selections, you can transfer the list of names to the To text box. See Figure 8.4 for an example of what this form should look like. |
|
|
|
|
|
|
|
|
Figure 8.4
Email with transfer capability. |
|
|
|
|
|
|
|
|
Examples Filename: Email.frm |
|
|
|
|
|